package org.nepu.scr.indexrate.converter.upgraderate.operationreliability;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.upgraderate.operationreliability.FunctionTest5_1;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class FunctionTest5_1Converter implements AttributeConverter<FunctionTest5_1, String> {
    @Override
    public String convertToDatabaseColumn(FunctionTest5_1 functionTest5_1) {
        return JSONUtil.toJsonStr(functionTest5_1);
    }

    @Override
    public FunctionTest5_1 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, FunctionTest5_1.class);
    }
}
